package com.godGuang.file.uplpadEnum;

/**
 * @program: godGuang
 * @description:
 * @author: godGuang
 * @create: 2024-01-08 15:36
 **/
public enum FileEnum {
    LOCAL(1, "本地"),
    MINIO(2, "MinIO"),
    FASTDFS(3, "FastDFS"),
    OSS(4, "OSS");
    private Integer typeId;

    private String typeName;

    FileEnum() {
    }

    FileEnum(Integer typeId, String typeName) {
        this.typeId = typeId;
        this.typeName = typeName;
    }

    public Integer getTypeId() {
        return typeId;
    }

    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    public static FileEnum getEnum(Integer typeId) {
        for (FileEnum fileEnum : FileEnum.values()) {
            if (fileEnum.typeId.equals(typeId)) {
                return fileEnum;
            }
        }
        return null;
    }
}
